﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IceDog.DNL.CSharp.DesignPattern.CommandPattern.StockMarket
{
    /// <summary>
    /// 股票
    /// </summary>
    public class Stock
    {
        public string Name { get; set; }
        public decimal Quantity { get; set; }

        public Stock()
        {
            Name = "ABC";
            Quantity = 10;
        }

        /// <summary>Initializes a new instance of the <see cref="T:System.Object"></see> class.</summary>
        public Stock(string name, decimal quantity)
        {
            Name = name;
            Quantity = quantity;
        }

        public void Buy()
        {
            Console.WriteLine($"Stock [ Name: {Name},Quantity: {Quantity} ] bought");
        }

        public void Sell()
        {
            Console.WriteLine($"Stock [ Name: {Name},Quantity: {Quantity} ] sold");
        }
    }
}
